- listing
- listing/0 (L)
Lists in the current output stream the clauses for all the interpreted
predicates in the program, except predicates that are ``internal'',
i.e. whose names begin with `$' or `_$',
or which are provided as predefined (builtin or library) predicates.
A bug in the current system is that even though the
user is allowed to redefine such predicates,
listing/0 does not know about such redefinitions,
and will not list such predicates (they may, however,
be accessed through listing/1 if they are interpreted).
- listing(A)
- listing/1 (L)
The argument A may be a predicate specification of
the form Name/Arity in which case only the clauses for the
specified predicate are listed.
Alternatively, it is possible for A to be a list
of predicate specifications, e.g.
| ?- listing([concatenate/3, reverse/2, go/0]).
Only interpreted clauses, i.e. clauses created via assert,
can be accessed through listing/1.
- current_atom(Atom)
- current_atom/1 (L)
$current_atom/2 (L)
Generates (through backtracking) all currently known atoms, and unifies
each in turn with Atom.
However, atoms considered ``internal'' symbols,
i.e. those whose names begin with $ or _$ are not returned.
The intrepid user who wishes to access such internal atoms as
well can use the goal
?- $current_atom(Atom, 1).
- current_functor(Name, Term)
- current_functor/2 (L)
$current_functor/3 (L)
Generates (through backtracking) all currently known functors (which
includes function and predicate symbols), and for each one returns its name
and most general term as Name and Term respectively.
However, functors considered ``internal'' symbols, i.e. those whose names
begin with $ or _$, or which are provided as predefined
predicates, are not returned if both arguments to current_functor/2
are variables.
Internal symbols (of which there are a great many)
as well as external ones may be accessed via
?- $current_functor(Name, Term, 1).
A bug in the current implementation is that even though the user is allowed
to redefine ``internal'' (builtin or library) predicates,
current_functor/2 does not know whether they have been redefined,
and hence will not return such predicates if both arguments to
current_functor/2 are variables.
- current_predicate(Name, Term)
- current_predicate/2 (L)
$current_predicate/3 (L)
Generates (through backtracking) all currently known predicates, and for
each one returns its name and most general term as Name and Term
respectively.
However, predicates considered ``internal'',
i.e. those whose names begin with $ or _$,
or which are provided as predefined predicates,
are not returned if both arguments to current_predicate/2
are variables.
Internal symbols (of which there are a great many)
as well as external ones may be accessed via
?- $current_predicate(Name, Term, 1).
A bug in the current implementation is that even though the user is allowed
to redefine ``internal'' (builtin or library) predicates,
current_predicate/2 does not know whether they have been redefined,
and hence will not return such predicates if both arguments to
current_predicate/2 are variables.
- predicate_property(Term, Property)
- predicate_property/2 (L)
If Term is a term whose principal functor is a predicate,
Property is unified with the currently known properties of the
corresponding predicate.
If Term is a variable, then it is unified (successively,
through backtracking) with the most general term for a
predicate whose known properties are unified with Property.
For example, all the interpreted predicates in the program may be enumerated
using
?- predicate_property(X, interpreted).
If the first argument to predicate_property/2
is uninstantiated at the time of the call,
``internal'' predicates will not be returned.
A bug in the current implementation is that even though the user is allowed
to redefine such ``internal'' predicates,
predicate_property/2 does not know about such redefinitions,
and will not return such predicates if its first argument is uninstantiated.
Currently, the only properties that are considered are
interpreted and compiled.